--- gcc-4.5.3/configure
+++ gcc-patched/configure
@@ -3006,6 +3006,21 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""
 
+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
+# Make sure we don't let target-libstdc++ be added if we didn't want it.
+if test x$with_target_libstdcxx = xno ; then
+  noconfigdirs="$noconfigdirs target-libstdc++-v3"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
--- gcc-4.5.3/configure.ac
+++ gcc-patched/configure.ac
@@ -252,6 +252,21 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""
 
+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
+# Make sure we don't let target-libstdc++ be added if we didn't want it.
+if test x$with_target_libstdcxx = xno ; then
+  noconfigdirs="$noconfigdirs target-libstdc++-v3"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
